package com.ice.video;
/*
 * 类描述：
 * 伟大的创建人：ice   
 * 不可相信的创建时间：17/6/15 下午3:11 
 * 爱信不信的修改时间：17/6/15 下午3:11 
 * @version
 */

import android.app.Application;
import android.os.Environment;
import android.util.Log;

import java.io.File;

import mabeijianxi.camera.VCamera;
import mabeijianxi.camera.util.DeviceUtils;

public class App extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        initRecord();
    }

    private void initRecord() {
        // 设置拍摄视频缓存路径
        File dcim = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM);
        Log.e("TAG", "initSmallVideo: " + dcim.getAbsolutePath());
        if (DeviceUtils.isZte()) {
            if (dcim.exists()) {
                VCamera.setVideoCachePath(dcim + "/mabeijianxi/");
            } else {
                VCamera.setVideoCachePath(dcim.getPath().replace("/sdcard/",
                        "/sdcard-ext/")
                        + "/mabeijianxi/");
            }
        } else {
            VCamera.setVideoCachePath(dcim + "/mabeijianxi/");
        }
        VCamera.setDebugMode(true);
        VCamera.initialize(this);
    }


}
